import {
  request
} from "../utils/request";
/**
 * 订单列表
 */
export function getTradeOrderList(data) {
  return new Promise(res => {
    res(request('/tradeOrderController/getTradeOrderList', 'POST', data, {
      'Content-Type': 'application/json'
    }))
  })
}
/**
 * 待处理配送 json形式TradeOrderVO  custId = 客户id   status = ''
 * 已完成配送 json形式CloudPointFlow  custId = 客户id   status = 40
 */
export function getTradeOrderListByCustIdAndStatus(data) {
  return new Promise(res => {
    res(request('/tradeOrderController/getTradeOrderListByCustIdAndStatus', 'POST', data, {
      'Content-Type': 'application/json'
    }))
  })
}
/**
 * 接受订单
 */
export function acceptOrder(data) {
  return new Promise(res => {
    res(request('/tradeOrderController/acceptOrder', 'POST', data))
  })
}
/**
 * 转让订单
 */
export function orderTransfer(data) {
  return new Promise(res => {
    res(request('/tradeOrderController/orderTransfer', 'POST', data,{
      'Content-Type': 'application/json'
    }))
  })
}
/**
 * 完成订单
 */
export function completeOrder(data) {
  return new Promise(res => {
    res(request('/tradeOrderController/completeOrder', 'POST', data))
  })
}
/**
 * 复购物车产品下订单
 */
export function repurchasePlaceOrder(data) {
  return new Promise(res => {
    res(request('/tradeOrderController/repurchasePlaceOrder', 'POST', data))
  })
}
/**
 * 复购产品下订单
 */
export function placeAnOrder(data) {
  return new Promise(res => {
    res(request('/tradeOrderController/placeAnOrder', 'POST', data))
  })
}
/**
 * 根据custId查询订单状态数量
 */
export function getTradeOrderCountByCustId(data) {
  return new Promise(res => {
    res(request('/tradeOrderController/getTradeOrderCountByCustId', 'POST', data,{
      'Content-Type': 'application/json'
    }))
  })
}
/**
 * 获取直接推荐人下的订单集合
 */
export function getTradeOrderVOByBbId(data) {
  return new Promise(res => {
    res(request('/tradeOrderController/getTradeOrderVOByBbId', 'POST', data))
  })
}
/**
 * 获取间接推荐人下的订单集合
 */
export function getTradeOrderVOByYyId(data) {
  return new Promise(res => {
    res(request('/tradeOrderController/getTradeOrderVOByYyId', 'POST', data))
  })
}

/**
 * 获取间接推荐人下的订单集合
 */
export function getTradeOrderVOByCustId(data) {
  return new Promise(res => {
    res(request('/tradeOrderController/getTradeOrderVOByCustId', 'POST', data))
  })
}

/**
 * 获取待本人发货的订单数量
 */
export function getMeSendingOrderCnt(data) {
  return new Promise(res => {
    res(request('/tradeOrderController/getMeSendingOrderCnt', 'POST', data))
  })
}